package com.yuma.mediator;

public class MediatorTest {
    public static void main(String[] args) {
        ChatServer chatServer = new ChatServer();
        ChatUser chatUser1 = new ChatUser("张三", chatServer);
        ChatUser chatUser2 = new ChatUser("李四", chatServer);
        ChatUser chatUser3 = new ChatUser("王五", chatServer);
        chatUser1.join();
        chatUser2.join();
        chatUser3.join();

        chatUser1.sendToUser("明天去哪玩啊?");
        chatUser2.sendToUser("哪也不去，在家学习");
        chatUser3.sendToUser("去发现王国吧");

        System.out.println("------------------------------");
        chatUser2.remove();
        chatUser1.sendToUser("我能去");
    }
}
